package com.xq.tmall.service;

import com.xq.tmall.dao.StockDailyBasicDao;
import com.xq.tmall.entity.StockDailyBasic;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Service
public class StockDailyBasicService {

    @Resource
    private StockDailyBasicDao stockDailyBasicDao;

    /**
     * 更新单条数据
     * @param stockDailyBasic
     * @return
     */
    public int updateByPrimaryKeySelective(StockDailyBasic stockDailyBasic){
        return stockDailyBasicDao.updateByPrimaryKeySelective(stockDailyBasic);
    }

    /**
     * 删除数据根据代码
     * @param code
     * @return
     */
    public int deleteByCode(String code){
        return stockDailyBasicDao.deleteByCode(code);
    }


    /**
     * 插入数据
     * @param stockDailyBasic
     * @return
     */
    public int insertSelective(StockDailyBasic stockDailyBasic){
        return stockDailyBasicDao.insertSelective(stockDailyBasic);
    }

    public int batchInsert(List<StockDailyBasic> stockDailyBasicList){
        return stockDailyBasicDao.batchInsert(stockDailyBasicList);
    }
}
